<div class="container">
  <h1>get_where()</h1>
  <p class="signature">public function get_where(int $id, ?string $target_table = null): object|false</p>
  
  <h2>Description</h2>
  <div class="description">
    <p>
      Fetches a single record by its ID from a database table. This method constructs and executes an SQL query to retrieve the record with the specified ID from the specified table. If no record is found, it returns false.
    </p>
  </div>
  
  <h2>Parameters</h2>
  <table>
    <thead>
      <tr>
        <th>Parameter</th>
        <th>Type</th>
        <th>Description</th>
        <th>Default</th>
        <th>Required</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>id</td>
        <td>int</td>
        <td>The ID of the record to fetch.</td>
        <td>N/A</td>
        <td>Yes</td>
      </tr>
      <tr>
        <td>target_table</td>
        <td>string|null</td>
        <td>The name of the database table to be queried. If not explicitly passed, the table name is assumed to be the value of the first URL segment.</td>
        <td>'First URL segment'</td>
        <td>No</td>
      </tr>
    </tbody>
  </table>
  
  <h2>Return Value</h2>
  <table>
    <thead>
      <tr>
        <th>Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>object|false</td>
        <td>An object representing the fetched record, or false if no record is found.</td>
      </tr>
    </tbody>
  </table>
  
  <h2>Exceptions</h2>
  <table>
    <thead>
      <tr>
        <th>Exception Type</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td>RuntimeException</td>
        <td>Thrown if the query execution fails.</td>
      </tr>
    </tbody>
  </table>

  <h2>Example Usage #1</h2>
  <p>The code sample below demonstrates how to fetch a single record from the 'products' table with the ID '123'.</p>
  <div class="example">
    <pre>
$product_obj = $this->model->get_where(123, 'products');</pre>
  </div>

  <h2>Example Usage #2</h2>
  <p>In this alternative example, no table name has been passed into the method. This means that the table name will be assumed to be the value of the first URL segment.</p>
  <div class="example">
    <pre>
$user_obj = $this->model->get_where(456);</pre>
  </div>

</div>
